<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            border: 8px solid #c9a4eb;
            padding: 25px;
            margin: 50px;
            /* 此时盒子最终大小为：200+25*2+8*2+50*2=366 */
        }

        .box1 {
            width: 100px;
            height: 100px;
            border: 3px solid #56e22b;
            padding: 7px;
        }
    </style>
</head>

<body>
    <!--         
        1.1看透网页布局：网页元素基本上都是盒子box
        1.2盒子模型的组成：边框border 内容content(即实际设置的宽高) 内边距padding 外边距margin
        所以最终的盒子大小为边框+内容+内边距+外边距
         -->
    <div class="box">
        <div class="box1"></div>
    </div>
</body>

</html>